<?php
   
   
   class Conexao{
   	
	
		public static $instace;
		
		private function __construct(){
			
			
		}
		
		public static function getInstance(){
			
			
			if(!isset(self::$instace)){
				
				self::$instace = new PDO('mysql:host=localhost; dbname=db_armazem', 'root','', 
				array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
				
				self::$instace->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
				self::$instace->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING);
			
			}
			
			return self::$instace;
		}
	
	
	
   }
   
   
   
   
   
   
   
?>